package zjt.IO1;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;

public class demo7 {
    public static void main(String[] args) throws Exception {
        InputStreamReader inputStreamReader =
                new InputStreamReader(new FileInputStream("c:\\a.txt"));
        //2.按照gbk编码集读取文件
        InputStreamReader inputStreamReader2 =
                new InputStreamReader(new FileInputStream("c:\\a.txt"),"gbk");
        //3.将数据按照平台默认编码集写入到b.txt文件
        OutputStreamWriter writer =
                new OutputStreamWriter(new FileOutputStream("c:\\b.txt"));
        //4.将数据按照gbk编码集写入到b.txt文件
        OutputStreamWriter writer2 =
                new OutputStreamWriter(new FileOutputStream("c:\\b.txt"),"gbk");
    }
}